import numpy as np
import matplotlib.pyplot as plt

# Define the domain
h = 0.1  # Step size
x = np.linspace(0, 1, int(1/h) + 1)  # Grid points

# Define the Fourier mode
def fourier_mode(x, k):
    return np.sin(k * np.pi * x)

# Plot for different k values
k_values = [1, 2, 5, 10]  # Example wavenumbers
plt.figure(figsize=(10, 6))
for k in k_values:
    plt.plot(x, fourier_mode(x, k), label=f'k = {k}')

plt.title('Fourier Modes on $\\Omega_h$')
plt.xlabel('x')
plt.ylabel('$w_k(x)$')
plt.legend()
plt.grid(True)
plt.savefig('9.11.png')  # Save the plot for LaTeX
plt.show()